import java.util.Scanner;

public class TestYY {
    public static void main(String[] args) {
        String in;
        char max;
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            in = sc.next();
            char[] a;
            a = in.toCharArray();
            max = a[0];
            for (char c : a) {
                if (c > max) {
                    max = c;
                }
            }
            StringBuilder sb = new StringBuilder();
            for (char c : a) {
                sb.append(c);
                if (c == max) {
                    sb.append("(max)");
                }
            }
            System.out.println(sb.toString());
        }
    }
}
